#!/usr/bin/env bash

if [ "`ping -c 1 corp.wan`" ]; then
    if [ -e "/mnt/share" ]; then
        USER=`whoami`
        unison -batch -perms=0 /mnt/share/work/current/ /home/$USER/src/work/
    else
        echo "Remote directory not mounted"
    fi
else
    echo "Corporate network not available"
fi
